package cn.bugstack.mybatis.transaction.jdbc;

import cn.bugstack.mybatis.session.TransactionIsolationLevel;
import cn.bugstack.mybatis.transaction.Transaction;
import cn.bugstack.mybatis.transaction.TransactionFactory;

import javax.sql.DataSource;
import java.sql.Connection;


public class JdbcTransactionFactory implements TransactionFactory{

    @Override
    public Transaction newTransaction(Connection conn){
        return new JdbcTransaction(conn);
    }


    @Override
    public Transaction newTransaction(DataSource dataSource, TransactionIsolationLevel level, boolean autoCommit){
        return new JdbcTransaction(dataSource, level, autoCommit);
    }
}
